<script type="text/javascript">	
{literal}	
	$(document).ready(function() {
		// INIT ROOM ARRAY	
		roomArray = new Array();	
		$('#room_list tbody').children().each(function() {		
			roomArray.push($(this).attr('id'));			
		});				
		
		$('#service_name').blur(function() {
{/literal}
			isNotEmpty($(this), "{translate}Empty service name{/translate}", "status_message");
{literal}
		});
		
		$('#price').blur(function() {
{/literal}			
			var msg = "{translate}Empty price of service{/translate}";
{literal}
			if (isNotEmpty($(this), msg, "status_message")) {
{/literal}
				checkNumber($(this), "{translate}Invalid price of service{/translate}", "status_message", "#AAA");
{literal}				
			}
		});
		
		$('#required_insurance_price').blur(function() {
{/literal}
			checkNumber($(this), "{translate}Invalid price of required insurance{/translate}", "status_message", "#AAA");
{literal}
		}); 
		
		$('#volunteered_insurance_price').blur(function() {
{/literal}
			checkNumber($(this), "{translate}Invalid price of volunteered insurance{/translate}", "status_message", "#AAA");
{literal}
		});
	});	
{/literal}
</script>
<br />
<form id="add_service_form" name="add_service_form">
<input type="hidden" id="service_id" name="service_id" value="{$testItem->get_id()}">
<div class="form_container" style="width: 680px;">
	<div>
		<span id="status_message" style="font-style: italic; color: red;"></span>
	</div>
	<table cellspacing="0" cellpadding="0">
		<tr>
			<td colspan="6" class="field" style="text-transform: uppercase">{translate}Test detail{/translate}</td>
		</tr>
		<tr>
			<td class="label">{translate}Test name{/translate}</td>
			<td colspan="3" class="field">
				<input id="service_name" name="service_name" type="text" size="65" value="{$testItem->getLocalizedText('name')}">
			</td>			
			<td class="label">{translate}Lock{/translate}</td>
			<td class="field">
				<input type="radio" name="disabled" value="1"
				{if $testItem->get('disabled') == 1}checked="checked"{/if}>{translate}Yes{/translate}
				<input type="radio" name="disabled" value="0"
				{if $testItem->get('disabled') == 0}checked="checked"{/if}>{translate}No{/translate}
			</td>
					 			
		</tr>
		<tr>
			<td class="label">{translate}Price{/translate}</td>
			<td class="field"><input id="price" name="price" type="text" size="15" value="{$testItem->get('price')}"></td>
			<td class="label">{translate}RI payment{/translate}</td>
			<td class="field"><input id="required_insurance_price" name="required_insurance_price" type="text" size="15" value="{$testItem->get('required_insurance_price')}"></td>
			<td class="label">{translate}VI payment{/translate}</td>
			<td class="field"><input id="volunteered_insurance_price" name="volunteered_insurance_price" type="text" size="15" value="{$testItem->get('volunteered_insurance_price')}"></td>
		</tr>		
		<tr>			
			<td class="label">{translate}Patient has RI payment{/translate}</td>
			<td class="field"><input id="patient_required_insurance_price" name="patient_required_insurance_price" type="text" size="15" value="{$testItem->get('patient_required_insurance_price')}"></td>
			<td class="label">{translate}Patient has VI payment{/translate}</td>
			<td class="field"><input id="patient_volunteered_insurance_price" name="patient_volunteered_insurance_price" type="text" size="15" value="{$testItem->get('patient_volunteered_insurance_price')}"></td>
		</tr>
		<tr>
			<td class="label">{translate}Test type{/translate}</td>
			<td class='field' colspan='5'>
				<select id="testService" name="testService" style="width: 150px;">					
					{html_options options=$testGroupList selected=$selectedTestGroup}
				</select>
			</td>
		</tr>
	</table>
	
</div>

<div align="right" style="padding-top: 10px; padding-right: 137px;">
	<div id="btn_save">
		<a id="button_save" class="button_link" href="javascript:saveTestItem();">
			{if $testItem->get_id() > 0}
				{translate}Save{/translate} 					
			{else}
				{translate}Add new test{/translate}
			{/if}
		</a>
	</div>
	<div id="barLoading" style="display:none;">
		<img src="{$base_uri}images/ajax-loader.gif"/>
	</div>
</div>

</form>

